package Shared;

/**
 * Object representing an Ambulance state.
 * 
 */
public enum AmbState {
	WAIT_FOR_MISSION("Waiting", false), ASSIGNED("Assigned", false), DISPATCHED("Dispatched", true), ON_ITS_WAY(
			"On it's way", true), CONFIRMATION_REQUESTED("Waiting for confirmation of location", true), ON_PLACE(
			"On place", true), BUSY("Busy", false), INACTIVE("Inactive (nobody logged in)", false), ERROR(
			"Error occured during mission", true), UNREGISTERED("Not yet registered", false);

	private String descr;
	private boolean isOnMission;

	private AmbState(String s, boolean isOnMission) {
		this.descr = s;
		this.isOnMission = isOnMission;
	}

	/**
	 * Returns the description of the ambulance state.
	 */
	public String toString() {
		return this.descr;
	}

	/**
	 * 
	 * @return true if this state means that the ambulance is on a mission,
	 *         false otherwise.
	 */
	public boolean isOnMission() {
		return this.isOnMission;
	}
}
